home *** CD-ROM | disk | FTP | other *** search
- Path: seagull.rtd.com!collins
- From: collins@RTD.COM (Ronald Collins)
- Newsgroups: comp.lang.c
- Subject: Re: Standard question - pointer initialization
- Date: 17 Mar 1996 17:44:14 GMT
- Organization: RTD Internet Access
- Message-ID: <4ihj1e$c83@baygull.rtd.com>
- References: <4hk9un$906@hammer.msfc.nasa.gov> <4hnpsl$g8c@hacgate2.hac.com> <4hq9hsINN998@keats.ugrad.cs.ubc.ca> <4i7cgn$5da@baygull.rtd.com> <4i9jfdINNbbv@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: seagull.rtd.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) wrote:
- : In article <4i7cgn$5da@baygull.rtd.com>,
- : Ronald Collins <collins@RTD.COM> wrote:
- : >Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) wrote:
- : >
- [snip]
-
- : You read the standard _and_ the FAQ yourself! In what the rest of the world
- : agrees upon as the the definition of the C language, constant integral
- : expressions with a value of zero are converted to a null pointer when they
- : appear in a pointer context (such as an assignment to, or comparison with,
- : a pointer).
-
- This is only true for _constant_ expressions of 0 (see Tanmoy's post).
- Not every "0" is a constant "0". For example, setting a variable to 0,
- then casting that variable to a pointer _does not_ guarantee a conversion
- to the NULL pointer.
-
- [another snip]
-
- : As a newcomer to comp.lang.c, you have fallen into the trap of assuming
- : that since you are competent in C programming, the contents of the FAQ
- : is just a bunch of stuff that agrees with what you already know, and
- : thus you are exempt from actually reading it, though as an obvious
- : expert you may refer others to the document.
- : --
-
- Actually, the FAQ has been one of my standard desk references for
- several years. Your original post of saying "a 0 converts to a NULL"
- was ambiguous; in the context I read it I took it to mean _any_ 0
- will cast to a NULL. This is not the case.
-
- If I ("an obvious expert" ?) can mis-understand your postings, what about
- the people who come here looking for answers to (for them) very
- confusing situations?
-
- -- collins --
-
-